<?php
/*
 * @Author: 李志刚
 * @CopyRight: 2020-2030 衡水山木枝技术服务有限公司
 * @Date: 2021-10-19 10:15:22
 * @Description: 平台商品分类
 * @LastEditors: 李志刚
 * @LastEditTime: 2021-10-21 15:02:34
 * @FilePath: /team_commission/database/migrations/shop/base/2021_10_19_101522_create_category.php
 */

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateCategory extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('good_categorys', function (Blueprint $table) {
            $table->engine = 'InnoDB';
            $table->id();
            $table->integer('parentid')->default(0)->comment('父 ID');
            $table->string('arrparentid')->nullable()->default('0')->comment('所有父 ID');
            $table->boolean('child')->default(0)->comment('是否有子栏目');
            $table->text('arrchildid', 16777215)->nullable()->comment('所有子栏目');
            $table->string('name', 150)->default('栏目')->comment('栏目名称');
            $table->string('thumb')->nullable()->comment('缩略图');
            $table->integer('sort')->default(0)->comment('排序');
            $table->boolean('display')->default(1)->comment('1显示，0不显示');
            $table->tinyInteger('del_flag')->default(0)->comment('删除状态（1删除 0正常）');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('categorys');
    }
}
